//用户管理-用户列表-配置文件
App.util.ns('Admin.User.User');
Admin.User.User.Conf = {
    columns: [
        {name: '昵称', value: 'nickname'},
        {name: '电话', width: '60px',value: 'phone'},
        {name: '性别', width: '60px',value: function(item){
            switch (item.gender+'') {
                    case '0':
                        return '未知';
                    case '1':
                        return '男';
                    case '2':
                        return '女';
            }
        }},
        {name: '企业', width: '100px', value: function(item){
            return item.enterprise ? item.enterprise.name : '-- --';
        }},
        {name: '押金', width: '60px',value: 'deposit'},
        {name: '押金状态', width: '70px', value: function(item){
            switch (item.deposit_status+'') {
                case '0':
                    return '未交';
                case '1':
                    return '已交';
            }
        }},
        {name: '押金订单名', width: '150px', value: function(item){
            return item.orders ? item.orders.order_name : '-- --';
        }},
        {name: '余额', width: '60px',value: 'balance'},
        {name: '积分', width: '60px',value: 'score'},
        {name: '企业福利', width: '80px',value: 'enterprise_fee'},
        {name: '状态', width: '60px',value: function(item){
            switch (item.status+'') {
                case '1':
                    return '正常';
                case '2':
                    return '禁用';
            }
        }},
        {name: '创建日期', width: '80px', value: function(item){
            return App.util.formator.date(item.created_at);
        }}
    ],
    form: [
        {type: 'hidden', name: 'id'},
        {type: 'input', name: 'nickname', title: '昵称', required: true, maxLength: 40, rule: {
            type: 'str',
            range: [1, 40]
        }},
        {type: 'img', name: 'img', title: '头像',rule: {
            type: 'str',
            range: [0, 255]
        }},
        {type: 'input', name: 'address', title: '联系地址', maxLength: 40, rule: {
            type: 'str',
            range: [1, 500]
        }},
        {type: 'input', name: 'phone', title: '电话', required: true, rule: {
            type: 'str',
            range: [0, 100]
        }},
        {type: 'input', name: 'email', title: '邮箱', rule: {
            type: 'str',
            range: [0, 100]
        }},
        {type: 'chosen', name: 'gender', title: '性别', items: [
            ['0', '未知'],
            ['1', '男'],
            ['2', '女']
        ]}
    ]
};